from sqlalchemy.orm import Mapped, mapped_column
from sqlalchemy import Boolean, DateTime, func
from datetime import datetime
from ..db import db


class BaseModel(db.Model):
    __abstract__ = True
    is_deleted: Mapped[bool] = mapped_column(Boolean, default=False)
    created: Mapped[datetime] = mapped_column(DateTime, default=func.now(), onupdate=func.now())
    updated: Mapped[datetime] = mapped_column(DateTime, default=func.now())